// pages/home/index.js

var util = require('../../utils/util.js');
var ajax = require('../../utils/ajax.js');
var common = require('../../utils/common.js');
var PageBase = require('../../common/PageBase.js');
var app = getApp();

Page(common.extendPage(PageBase, {
  data: {
    countDown:0
  },
  onLoad() {
    this.hiddenAd();
  },
  onShow() {
    
  },
  /**
   * 隐藏页面
   */
  hiddenAd() {
    var countDown = this.data.countDown;
    var countDownFun = setInterval((item, index) => {
      countDown--;
      this.setData({
        countDown
      })
      if (countDown <= 0) {
        clearInterval(countDownFun);
        wx.reLaunch({
          url: '/pages/home/index',
        })
      }
    }, 1000);
  }
}));